<html lang="en">
	<head>
		<title>{{title}} - Roxy-WI</title>
		<meta charset="UTF-8">	
		<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
		<meta http-equiv="Pragma" content="no-cache" />
		<meta http-equiv="Expires" content="0" />
		{% if title == 'Login page' %}
		<meta name="viewport" content="width=device-width, user-scalable=1">
		{% endif %}
		<link href="/inc/images/favicon/favicon.ico" rel="icon" type="image/png" />
		<link rel="apple-touch-icon" sizes="57x57" href="/inc/images/favicon/inc/images/favicon/apple-icon-57x57.png">
		<link rel="apple-touch-icon" sizes="60x60" href="/inc/images/favicon/apple-icon-60x60.png">
		<link rel="apple-touch-icon" sizes="72x72" href="/inc/images/favicon/apple-icon-72x72.png">
		<link rel="apple-touch-icon" sizes="76x76" href="/inc/images/favicon/apple-icon-76x76.png">
		<link rel="apple-touch-icon" sizes="114x114" href="/inc/images/favicon/apple-icon-114x114.png">
		<link rel="apple-touch-icon" sizes="120x120" href="/inc/images/favicon/apple-icon-120x120.png">
		<link rel="apple-touch-icon" sizes="144x144" href="/inc/images/favicon/apple-icon-144x144.png">
		<link rel="apple-touch-icon" sizes="152x152" href="/inc/images/favicon/apple-icon-152x152.png">
		<link rel="apple-touch-icon" sizes="180x180" href="/inc/images/favicon/apple-icon-180x180.png">
		<link rel="icon" type="image/png" sizes="192x192"  href="/inc/images/favicon/android-icon-192x192.png">
		<link rel="icon" type="image/png" sizes="32x32" href="/inc/images/favicon/favicon-32x32.png">
		<link rel="icon" type="image/png" sizes="96x96" href="/inc/images/favicon/favicon-96x96.png">
		<link rel="icon" type="image/png" sizes="16x16" href="/inc/images/favicon/favicon-16x16.png">
		<link rel="manifest" href="/inc/images/favicon/manifest.json">
		<meta name="msapplication-TileColor" content="#ffffff">
		<meta name="msapplication-TileImage" content="/inc/images/favicon/ms-icon-144x144.png">
		<meta name="theme-color" content="#ffffff">
		<script defer src="/inc/fa-solid.min.js"></script>
		<script defer src="/inc/fontawesome.min.js"></script>
		<script>FontAwesomeConfig = { searchPseudoElements: true, observeMutations: false };</script>
		<script defer src="/inc/ion.sound.min.js"></script>
		<link href="/inc/awesome.css" rel="stylesheet">
		<link href="/inc/style.css" rel="stylesheet">
		<link href="/inc/nprogress.css" rel="stylesheet">
		<link href="/inc/jquery-ui.min.css" rel="stylesheet">
		<link href="/inc/jquery-ui.structure.min.css" rel="stylesheet">
		<script src="/inc/jquery-3.6.0.min.js"></script>
		<script src="/inc/jquery-ui.min.js"></script>
		<script src="/inc/js.cookie.min.js"></script>
		<script src="/inc/reconnecting-websocket.js"></script>
		<link href="/inc/select2.css" rel="stylesheet" />
		<script src="/inc/select2.js"></script>
		<script src="/inc/script.js"></script>
		<script src="/inc/nprogress.js"></script>
		<link href="/inc/toastr.css" rel="stylesheet"/>
		<script src="/inc/toastr.js"></script>
	</head>
	<body>
		<input type="hidden" id="token" value="{{ token }}">
		<div class="top-menu">
			<div class="LogoText">
				<span id="logo_text">
					<a href="https://roxy-wi.org" title="Roxy-WI site" target="_blank">
						<img src="/inc/images/logo_menu.png" alt="logo" width="170" />
					</a>
				</span>			
			</div>	
			<div id="top-link" class="top-link">
				<nav id="menu">
					<ul class="menu">
						{% if user %}	
						<li><a href="/app/overview.py" title="Server and service status" class="overview-link">Overview</a></li>
						{% if '1' in user_services %}
						<li class="p_menu">
							<a href="/app/hapservers.py" title="HAProxy servers overview" class="config-show">Haproxy</a>
							<ul class="v_menu">
								<li><a href="/app/hapservers.py" title="HAProxy servers overview" class="overview-link head-submenu">Overview</a> </li>
								<li><a href="/app/config.py" title="Working with HAProxy configs" class="edit head-submenu">Configs</a></li>
								<li><a href="/app/viewsttats.py" title="HAProxy statistics " class="stats head-submenu">Stats</a></li>
								<li><a href="/app/logs.py" title="HAProxy logs " class="logs head-submenu">Logs</a></li>
								<li><a href="/app/runtimeapi.py" title="Runtime API - Roxy-WI" class="runtime head-submenu">Runtime API</a></li>
								<li><a href="/app/metrics.py" title="HAProxy's metrics" class="metrics head-submenu">Metrics</a></li>
							{% if role <= 3 %}
								<li><a href="/app/add.py#proxy" title="Add proxy: Create proxy - Roxy-WI" class="add-proxy head-submenu" id="add1">Add proxy</a></li>
								<li><a href="/app/versions.py" title="Working with versions HAProxy configs" class="version head-submenu">Versions</a></li>
								<li><a href="/app/add.py#ssl" title="Add proxy: Upload SSL certificates - Roxy-WI" class="cert head-submenu" id="add3">SSL</a></li>
								<li><a href="/app/add.py#lists" title="Add proxy: Create and upload whitelists or blacklists - Roxy-WI" class="lists head-submenu" id="add7">Lists</a></li>
								<li><a href="/app/waf.py" title="Web application firewall" class="waf-menu head-submenu">WAF</a> </li>
							{% endif %}
							</ul>
						</li>
						{% endif %}
						{% if '2' in user_services %}
						<li class="p_menu">
							<a href="/app/hapservers.py?service=nginx" title="Overview NGINX servers" class="nginx-menu">NGINX</a>
							<ul class="v_menu">
								<li><a href="/app/hapservers.py?service=nginx" title="Overview NGINX servers" class="overview-link head-submenu">Overview</a></li>
								<li><a href="/app/config.py?service=nginx" title="Working with NGINX configs" class="edit head-submenu">Configs</a></li>
								<li><a href="/app/viewsttats.py?service=nginx" title="NGINX statistics" class="stats head-submenu">Stats</a></li>
								<li><a href="/app/logs.py?service=nginx" title="NGINX logs " class="logs head-submenu">Logs</a></li>
								<li><a href="/app/metrics.py?service=nginx" title="NGINX's metrics" class="metrics head-submenu">Metrics</a></li>
								{% if role <= 3 %}
								<li><a href="/app/versions.py?service=nginx" title="Working with versions NGINX configs" class="version head-submenu">Versions</a></li>
								<li><a href="/app/add.py?service=nginx#ssl" title="Add proxy: Upload SSL certificates - Roxy-WI" class="cert head-submenu" id="add3">SSL</a></li>
								{% endif %}
							</ul>
						</li>
						{% endif %}
						{% if '4' in user_services %}
						<li class="p_menu">
							<a href="/app/hapservers.py?service=apache" title="Overview Apache servers" class="apache-menu">Apache</a>
							<ul class="v_menu">
								<li><a href="/app/hapservers.py?service=apache" title="Overview Apache servers" class="overview-link head-submenu">Overview</a></li>
								<li><a href="/app/config.py?service=apache" title="Working with Apache configs" class="edit head-submenu">Configs</a></li>
								<li><a href="/app/logs.py?service=apache" title="Apache logs " class="logs head-submenu">Logs</a></li>
								{% if role <= 3 %}
								<li><a href="/app/versions.py?service=apache" title="Working with versions Apache configs" class="version head-submenu">Versions</a></li>
								<li><a href="/app/add.py?service=apache#ssl" title="Add proxy: Upload SSL certificates - Roxy-WI" class="cert head-submenu" id="add3">SSL</a></li>
								{% endif %}
							</ul>
						</li>
						{% endif %}
						{% if '3' in user_services %}
						{% if role <= 2 %}
						<li class="p_menu">
							<a href="/app/hapservers.py?service=keepalived" title="Overview Keepalived servers" class="ha">Keepalived</a>
							<ul class="v_menu">
								<li><a href="/app/hapservers.py?service=keepalived" title="Overview Keepalived servers" class="overview-link head-submenu">Overview</a> </li>
								<li><a href="/app/ha.py" title="Create and configure HA cluster - Roxy-WI" class="keepalived head-submenu">HA</a></li>
								<li><a href="/app/config.py?service=keepalived" title="Working with Keepalived configs" class="edit head-submenu">Configs</a></li>
								<li><a href="/app/logs.py?service=keepalived" title="Keepalived logs " class="logs head-submenu">Logs</a></li>
								<li><a href="/app/versions.py?service=keepalived" title="Working with versions Keepalived configs" class="version head-submenu keepalived_versions">Versions</a></li>
							</ul>
						</li>
						{% endif %}
						{% endif %}
							<li class="p_menu">
								<a title="Monitoring tools" class="stats">Monitoring</a>
								<ul class="v_menu">
									<li><a href="/app/smon.py?action=view" title="SMON Dashboard" class="overview-link head-submenu">SMON Dashboard</a></li>
									<li><a href="/app/smon.py?action=history" title="SMON History" class="lists head-submenu">SMON History</a></li>
									{% if role <= 3 %}
									<li><a href="/app/smon.py?action=add" title="SMON admin panel" class="edit head-submenu">SMON Admin panel</a></li>
									{% endif %}
									<li><a href="/app/smon.py?action=checker_history" title="Checker History" class="lists head-submenu">Checker History</a></li>
									<li><a href="/app/portscanner.py" title="Port scanner" class="port-scanner head-submenu">Port scanner</a></li>
									<li><a href="/app/nettools.py" title="Network tools" class="net-tools head-submenu">Network tools</a></li>
								</ul>
							</li>
						{% if role <= 2 %}
							<li class="p_menu">
								<a title="Servers manage" class="runtime">Servers</a>
								<ul class="v_menu">
									<li><a href="/app/servers.py#users" title="Servers: Manage users - Roxy-WI" class="users head-submenu">Users</a></li>
									<li><a href="/app/servers.py#servers" title="Servers: Manage servers - Roxy-WI" class="runtime head-submenu">Servers</a></li>
									<li><a href="/app/servers.py#ssh" title="Servers: Manage SSH credentials - Roxy-WI" class="admin head-submenu">SSH credentials</a></li>
									<li><a href="/app/servers.py#settings" title="Servers: Manage Roxy-WI settings - Roxy-WI" class="settings head-submenu">Settings</a></li>
									<li><a href="/app/servers.py#installproxy" title="Servers: Proxy service installation - Roxy-WI" class="hap-menu installproxy head-submenu">Proxy installation</a> </li>
									<li><a href="/app/servers.py#installmon" title="Servers: Monitoring service installation - Roxy-WI" class="hap1 installmon head-submenu">Monitoring installation</a> </li>
									<li><a href="/app/provisioning.py" title="Servers: Provisioning - Roxy-WI" class="hap1 head-submenu">Server provisioning</a> </li>
									<li><a href="/app/viewlogs.py?type=2" title="Servers: View internal logs - Roxy-WI" class="logs head-submenu">Internal logs</a></li>
									<li><a href="/app/servers.py#backup" title="Servers: Backup configs - Roxy-WI" class="backup head-submenu">Backups</a> </li>
								</ul>
							</li>
						{% endif %}
						{% if role <= 1 %}
							<li class="p_menu">
								<a title="Admin area" class="admin">Admin area</a>
								<ul class="v_menu">
									<li><a href="/app/users.py#users" title="Admin area: Manage users - Roxy-WI" class="users head-submenu">Users</a></li>
									<li><a href="/app/users.py#groups" title="Admin area: Manage groups - Roxy-WI" class="group head-submenu">Groups</a></li>
									<li><a href="/app/users.py#servers" title="Admin area: Manage servers - Roxy-WI" class="runtime head-submenu">Servers</a></li>
									<li><a href="/app/users.py#ssh" title="Admin area: Manage SSH credentials - Roxy-WI" class="admin head-submenu">SSH credentials</a></li>
									<li><a href="/app/users.py#settings" title="Admin area: Manage Roxy-WI settings - Roxy-WI" class="settings head-submenu">Settings</a></li>
									<li><a href="/app/users.py#services" title="Admin area: Manage Roxy-WI services - Roxy-WI" class="services head-submenu">Services</a></li>
									<li><a href="/app/viewlogs.py" title="Admin area: View internal logs - Roxy-WI" class="logs head-submenu">Internal logs</a></li>
									<li><a href="/app/users.py#updatehapwi" title="Admin area: Update Roxy-WI - Roxy-WI" class="upload updatehapwi head-submenu">Update</a></li>
								</ul>
							</li>
						{% endif %}	
					{% endif %}
					</ul>
				</nav>
			</div>
		</div>
		<div id="cover"></div>
		<div class="container">
			{% if h2 %}
				<h2>
					{{title}}
					{% include 'include/login.html' %}
					{% if autorefresh %}
						<span class="auto-refresh">
							<a onclick="pauseAutoRefresh()" class="auto-refresh-pause" style="display: none; margin-top: 4px;"></a>
							<a onclick="pauseAutoResume()" class="auto-refresh-resume" style="display: none; margin-top: 4px;"></a>
							<span id="0" class="auto-refresh-span"><span class="auto-refresh-reload auto-refresh-reload-icon"></span> Auto-refresh</span>
							<span id="1" style="display: none;" class="auto-refresh-span"><span class="auto-refresh-reload auto-refresh-reload-icon"></span> Auto-refresh</span>
						</span>		
					{% endif %}
				</h2>
			{% endif %}
			{% if autorefresh %}
				<div class="auto-refresh-div">
					<div class="auto-refresh-head">
						Refresh Interval
					</div>
					<div class="auto-refresh-interval">
						<div class="auto-refresh-ul">
							<ul style="width: 130px;">
								<li>
									<a class="ui-button ui-widget ui-corner-all" onclick="setRefreshInterval(0)" title="Turn off auto-refresh">No auto-refresh</a>
								</li>
							</ul>
						</div>
						<div class="auto-refresh-ul" id="secIntervals">
							<ul style="width: 100px;">
								<li><a title="Auto-refresh every 5 seconds" onclick="setRefreshInterval(5000)">5 seconds</a></li>
								<li><a title="Auto-refresh every 10 seconds" onclick="setRefreshInterval(10000)">10 seconds</a></li>
								<li><a title="Auto-refresh every 30 seconds" onclick="setRefreshInterval(30000)">30 seconds</a></li>
								<li><a title="Auto-refresh ever 45 seconds" onclick="setRefreshInterval(45000)">45 seconds</a></li>
							</ul>
						</div>
						<div class="auto-refresh-ul">
							<ul style="width: 100px;">
								<li><a title="Auto-refresh every 1 minute" onclick="setRefreshInterval(60000)">1 minute</a></li>
								<li><a title="Auto-refresh every 5 minutes" onclick="setRefreshInterval(300000)">5 minutes</a></li>
								<li><a title="Auto-refresh every 15 minutes" onclick="setRefreshInterval(900000)">15 minutes</a></li>
								<li><a title="Auto-refresh ever 30 minutes" onclick="setRefreshInterval(1800000)">30 minutes</a></li>
							</ul>
						</div>
						<div class="auto-refresh-ul">
							<ul style="width: 100px;">
								<li><a title="Auto-refresh every 1 hour" onclick="setRefreshInterval(3600000)">1 hour</a></li>
								<li><a title="Auto-refresh every 2 hour" onclick="setRefreshInterval(7200000)">2 hour</a></li>
								<li><a title="Auto-refresh every 12 hour" onclick="setRefreshInterval(43200000)">12 hour</a></li>
								<li><a title="Auto-refresh ever 1 day" onclick="setRefreshInterval(86400000)">1 day</a></li>
							</ul>
						</div>
					</div>
				</div>
			{% endif %}
			{% if h2 %}
				<ul id='browse_histroy'></ul>
			{% endif %}
			{% if role %}
				{% if role <= 2 %}
					<div id="apply" style="display: none;">
						<div class="alert alert-warning" id="apply_div"></div>
					</div>
				{% endif %}
			{% endif %}
			{% block content %}{% endblock %}
			<div id="ajax-compare"></div>
			<div id="ajax"></div>			
		</div>	
		<div id="show-updates" style="display: none;">	
			<div>
				There is a new version Roxy-WI. Check the <a href="/app/users.py#updatehapwi" class="link">Update page</a>
			</div>
		</div>	
		<div class="footer">
			<a href="#" id="hide_menu" title="Hide menu" style="float: left;">
				<span class="ui-state-default ui-corner-all">
					<span class="ui-icon ui-icon-arrowthick-1-w" id="arrow"></span>
				</span>
			</a>
			<div class="show_menu" style="display: none; float: left;">
				<a href="#" id="show_menu" title="Show menu">
					<span class="ui-state-default ui-corner-all">
						<span class="ui-icon ui-icon-arrowthick-1-e" id="arrow"></span>
					</span>
				</a>
			</div>
			<div id="version"></div>
			<div id="logo_footer">
				<a href="https://roxy-wi.org" title="Roxy-WI official site" target="_blank">
					<img src="/inc/images/logo_footer.png" alt="logo" id="logo_footer_img" />
				</a>
			</div>
			<div class="footer-div">
				<a href="https://roxy-wi.org" class="footer-link" target="_blank" title="About Roxy-WI">About</a>
				<a href="https://github.com/hap-wi/roxy-wi/issues" class="footer-link" target="_blank" title="Community help">Help</a>
				<a href="https://sd.roxy-wi.org" class="footer-link" target="_blank" title="Service Desk">SD</a>
				<a href="https://roxy-wi.org/contacts.py" class="footer-link" target="_blank">Contacts</a>
				<a href="https://roxy-wi.org/cabinet.py" class="footer-link" target="_blank" title="Private cabinet">Cabinet</a>
				<a href="https://roxy-wi.org/legal.py" class="footer-link" target="_blank" title="Legal Note">Legal</a>
			</div>
		</div>
		<div id="show-user-settings">
			<table class="overview" id="show-user-settings-table">
				<tr>
					<td class="padding20" style="width: 70%">Alerts</td>
					<td>
						<select id="disable_alerting">
							<option value="0" title="Alerts for all tabs are enabled">All alerts are enabled</option>
							<option value="1">Disable alerting</option>
						</select>
					</td>
				</tr>
				<tr id="show-user-settings-group"></tr>
			</table>
		</div>
		<div id="current-user-groups-dialog" style="display: none;">
			<div id="current-user-groups-form"></div>
		</div>
		{% include 'include/change_pass_form.html' %}
	</body>
</html>
